#ifndef __SERVER_NOTIFYSENDER_H__
#define __SERVER_NOTIFYSENDER_H__

#include "gwmessagemap.hpp"
#include "IMessageOperator.h"
#include "protonet.hpp"
#include "netlib.h"
#include "../Global.h"
#include "../../Sender/GlobalSender.h"

/**
*@file       GBServer_NotifySender.h
*@brief      send message GBServer_Notify
*
*@author     graywind
*@version    1.0.0.0
*@data       2012/3/16
*/

///message wrapper
class msgGBServer_Notify
{
public:
    static const int MessageId = GBServer_Notify;
    //TODO
    pnSessionHandle SessionId;
    ServerNotify    MsgContent;
    ///@brief    constructor
    ///param[in] session_id     identifier of the session
    ///param[in] server_type    server_type
    msgGBServer_Notify(int session_id, eServerType server_type):
    SessionId(session_id)
    {
        MsgContent.set_servertype(server_type);
    }
};

class HandleGBServer_Notify
{
public:
    ///@brief     handle message
    ///param[in]  msg     message wrapper of GBServer_Notify
    ///retval     void
    static void HandleMessage(msgGBServer_Notify* msg)
    {
        //TODO
        //Main Message: msgGlobal
        msgGlobal mainMsg(msg->SessionId, msgGBServer_Notify::MessageId, ProtoNet<ServerNotify>::IntoBytes(msg->MsgContent));
        gwMessagePort::ProcessMessage(&mainMsg);
    }
};
///[message wrapper]  [handler]
RegisterHandler(msgGBServer_Notify, HandleGBServer_Notify);

#endif
